package com.auth.manage.base.util.sharding.strategy;

public class DefaultShardingTableStrategy {
    // 同一个externalId的hashCode都相同
    public static int getTableIndex(String externalId, int tableCount){
        int hashCode = externalId.hashCode();
        return (int) (Math.abs((long) hashCode) % tableCount);
    }
}
